package com.tan;

import com.tan.domain.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

@SpringBootApplication
public class Day01SpringbootDome2Application {

    @Value("${user.names}")
    private static String namesa;

    @Value("${user.age}")
    private static Integer agea;

    public static void main(String[] args) {
        ApplicationContext applicationContext = SpringApplication.run(Day01SpringbootDome2Application.class, args);
        User user = (User) applicationContext.getBean("user");
        System.out.println(user);
        System.out.println("names:" + user.getNamesa() + "  age:" + user.getAgea());
        System.out.println("names:" + namesa + "  age:" + agea);
    }

}
